package Testdmo3;

import java.util.Objects;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:周次煜
 * Date: 2024-03-26
 * Time：18:17
 */


//abstract public class Shape {
//
//    abstract public  void draw();
//
//    abstract  void calcArea();
//
//    // 抽象类也是类，也可以增加普通方法和属性
//    public double getArea(){
//        return area;
//    }
//
//    protected double area; // 面积
//}
//
//
//class Triangle extends Shape{
//
//    @Override
//    public void draw() {
//        System.out.println("正在画三角形！");
//    }
//
//    @Override
//    void calcArea() {
//        System.out.println("正在计算三角形面积！");
//    }
//
//}
//
//
//class Test {
//    public static void main(String[] args) {
//        Shape s=new Triangle();
//        s.draw();
//        s.calcArea();
//    }
//}

class Student { }




class Preson {

   public int age;
   public String name;

    public Preson(int age, String name) {

        this.age = age;
        this.name = name;
    }


    @Override
    public int hashCode() {
        return Objects.hash(age, name);
    }
}


class  Test {
    public static void main(String[] args) {
        Preson preson1=new Preson(18,"小罗");
        Preson preson2=new Preson(18,"小罗");

        System.out.println(preson2.hashCode());
        System.out.println(preson1.hashCode());

    }


}